package org.darcy.utils.vo;

import java.io.Serializable;

import org.darcy.utils.common.ReturnCode;

import lombok.Builder;
import lombok.Data;

@Data
@Builder
public class ReturnVo<T> implements Serializable {

	private static final long serialVersionUID = 1;

	// 响应编码
	private Integer code;

	// 响应消息
	private String msg;

	// 返回的vo
	private T data;

	public boolean isSuccess() {
		if (ReturnCode.SUCCESS.equals(code)) {
			return true;
		}
		return false;
	}

	public ReturnVo() {
		super();
	}

	public ReturnVo(Integer code, String msg) {
		super();
		this.code = code;
		this.msg = msg;
	}

	public ReturnVo(Integer code, String msg, T data) {
		super();
		this.code = code;
		this.msg = msg;
		this.data = data;
	}
}